home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / mac / files / t_sys5 / unixcpio.gz / unixnet.cpio / 8530.c < prev    next >
C/C++ Source or Header  |  1994-07-11  |  665b  |  37 lines

  1. /* Routines generic to all interfaces with 8530s */
  2. #include "global.h"
  3. #include "8530.h"
  4.  
  5. /* Write 8530 register */
  6. void
  7. write_scc(ctl,reg,val)
  8. register int16 ctl;
  9. int16 reg,val;
  10. {
  11.     char i_state;
  12.  
  13.     i_state = disable();
  14.     /* Select register; note that point high is also written */
  15.     if(reg != R0)
  16.         outportb(ctl,(char)(NULLCODE|reg));
  17.     outportb(ctl,(char)val);
  18.     restore(i_state);
  19. }
  20. /* Read 8530 register */
  21. char
  22. read_scc(ctl,reg)
  23. register int16 ctl;
  24. char reg;
  25. {
  26.     char c,i_state;
  27.  
  28.     i_state = disable();
  29.     /* Select register; note that point high is also written */
  30.     if(reg != R0)
  31.         outportb(ctl,(char)NULLCODE|reg);
  32.     c = inportb(ctl);
  33.     restore(i_state);
  34.     return c;
  35. }
  36.  
  37.